#ifndef UTILITY_HPP
#define UTILITY_HPP

// Internal header conusmers should not include this header
// TODO How to enforce this internal header usage ?

// Utility functions used through out project

#include <boost/tuple/tuple.hpp>
#include <boost/iterator/zip_iterator.hpp>
#include <boost/range/iterator_range.hpp>

namespace green {
namespace internal {

/*!
 *
 */
template <class... Containers>
auto zip_range(Containers& ... containers)->decltype(boost::make_iterator_range(
    boost::make_zip_iterator(boost::make_tuple(containers.cbegin()...)),
    boost::make_zip_iterator(boost::make_tuple(containers.cend()...)))) {

  return {boost::make_zip_iterator(boost::make_tuple(containers.cbegin()...)),
          boost::make_zip_iterator(boost::make_tuple(containers.cend()...))};
}
}
}
#endif  // UTILITY_HPP
